package io.virtualapp.hook_sdk.xml;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;

import java.io.InputStream;
import java.util.ArrayList;

public class XStreamUtils {
    /**
     * 接卸xml成arraylist
     * */

    public <T>T analysisArr(Class clz, String str){
        XStream xstream = new XStream(new DomDriver());//创建Xstram对象
        xstream.autodetectAnnotations(true);
        xstream.processAnnotations(clz);
        xstream.ignoreUnknownElements();
        T obj = (T) xstream.fromXML(str);
        return obj;
    }

}
